#!/bin/sh

#trap "/bin/rm -f ${BATCH_HOME}/Batch$$.log" EXIT

cd ${BATCH_HOME}

. ${BATCH_HOME}/sh/classpath.sh

# dummy loop
for i in 1
do
    # Pre Process
    JID=`${JAVA_HOME}/bin/java batch.BatchStatus -start ID batchname`
    if [ $? -ne 0 ]; then
        break
    fi

    # Process
    ${BATCH_HOME}/batch/bat/sh/RunBatch.sh Batch1 -q $JID $*
    if [ $? -ne 0 ]; then
        break
    fi

    # Post Process
    ${JAVA_HOME}/bin/java batch.BatchStatus -continue -q $JID
    if [ $? -ne 0 ]; then
        break
    fi

    # Process
    ${BATCH_HOME}/batch/bat/sh/RunBatch.sh Batch2 -q $JID $*
    if [ $? -ne 0 ]; then
        break
    fi

    break
done

# Post Process
${JAVA_HOME}/bin/java batch.BatchStatus -end -q $JID

exit $?
